﻿

function Template(templateElement) {

    var template = {

        markup: templateElement.innerHTML.replace(/(<!--|-->|\n|\t)/g, ""),

        replace: function(pattern, value) {
            this.markup = this.markup.replace(new RegExp("\\" + pattern, "gm"), value);
            return this.markup;
        }

    };

    return template;

};